home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 1.iso / util / fsave10.zip / FSAVE.TXT < prev    next >
Text File  |  1994-07-29  |  89KB  |  2,311 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                                    FSave
  21.                       A Program to Simplify Filesaves
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.                            Shareware Version 1.0
  35.                      Documentation Version 1.5 7/29/94
  36.                       Copyright 1994 Kenneth A. Reek
  37.                             All Rights Reserved
  38.  
  39.  
  40.  
  41.  
  42. FSave is copyrighted software.  It is not in the public domain, nor  is  it
  43. distributed for free.  The author retains all rights to this software.
  44.  
  45. FSave is distributed as Shareware so you can try it out without risk to see
  46. if you like it.  Use it for two weeks.  If you don't like it, simply delete
  47. it and owe nothing.  If you continue to use FSave after the two week  trial
  48. period, you must register your copy.  The advantages of registration, a fee
  49. schedule, and a registration form may be found in the file  "register.txt";
  50. to  register,  fill  out  this  form  and  mail it with your payment to the
  51. author:
  52.  
  53.                               Kenneth A. Reek
  54.                               3090 Griffin Rd
  55.                       Churchville, NY USA 14428-9512
  56.  
  57. Thank you for helping to make the ShareWare concept work.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.                                    FSave
  72.  
  73.  
  74.                              Table of Contents
  75.  
  76.  
  77. 1    Preface .........................................................    1
  78. 1.1  Printing this Document ..........................................    1
  79. 1.2  Preface to the Shareware Version ................................    1
  80. 1.3  DISCLAIMER ......................................................    2
  81.  
  82. 2    Installation ....................................................    2
  83. 2.1  Where Do I Put It?  .............................................    2
  84. 2.2  Installing FSave ................................................    2
  85.  
  86. 3    A Quick Start ...................................................    2
  87. 3.1  Who Should Read This Chapter?  ..................................    2
  88. 3.2  Step By Step Instructions .......................................    3
  89.  
  90. 4    Design Philosophy ...............................................    5
  91. 4.1  Why FSave?  .....................................................    5
  92. 4.2  FSave Design Principles .........................................    5
  93.  
  94. 5    Understanding Configurations ....................................    6
  95. 5.1  Overview of Operation ...........................................    6
  96. 5.2  Configurations ..................................................    6
  97. 5.2.1 Global and Local Configurations ................................    6
  98. 5.2.2 Elements of a Configuration ....................................    7
  99. 5.2.3 Configuration Files ............................................    7
  100. 5.3  Common Configuration Problems ...................................    9
  101. 5.4  An Example ......................................................    9
  102.  
  103. 6    FSave Operation .................................................   13
  104. 6.1  Initialization ..................................................   13
  105. 6.2  Processing Files ................................................   14
  106. 6.3  Processing Subdirectories .......................................   15
  107. 6.4  Output Files ....................................................   15
  108. 6.5  Saving the Data .................................................   16
  109. 6.6  The Initialization File .........................................   16
  110. 6.7  Command Line Arguments ..........................................   19
  111. 6.8  Starting FSave ..................................................   21
  112. 6.9  Starting FSave from Windows .....................................   22
  113.  
  114. 7    Strategies for Using Configurations .............................   22
  115. 7.1  The Root Directory ..............................................   22
  116. 7.2  Subdirectories ..................................................   23
  117. 7.2.1 Static Directories .............................................   23
  118. 7.2.2 Dynamic Directories ............................................   24
  119. 7.2.3 Static/Dynamic Directories .....................................   24
  120. 7.2.4 The \windows Directory .........................................   25
  121. 7.2.5 The \windows\system Directory ..................................   25
  122. 7.3  Testing Configurations ..........................................   26
  123.  
  124. 8    Master Backups ..................................................   26
  125. 8.1  What Is a Master Backup?  .......................................   26
  126. 8.2  Creating a Master Backup ........................................   26
  127.  
  128.  
  129. 1.5                                - i -                            7/29/94
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.                                    FSave
  138.  
  139.  
  140. 8.3  Whole System Master Backup ......................................   27
  141.  
  142. 9    Restoring Files from Backups ....................................   28
  143. 9.1  Re-Deleting Deleted Files .......................................   28
  144. 9.2  Directory Index .................................................   29
  145. 9.3  Restoring Individual Files ......................................   29
  146.  
  147. 10   Incremental Backups .............................................   29
  148. 10.1 Incremental and Delta Backups ...................................   29
  149. 10.2 Restoring from Incremental Backups ..............................   30
  150.  
  151. 11   Alternate Configurations ........................................   30
  152. 11.1 Specifying an Alternate Configuration ...........................   30
  153. 11.2 Using Alternate Configurations ..................................   31
  154.  
  155. 12   Unix-Style Filename Patterns ....................................   31
  156. 12.1 Overview ........................................................   31
  157. 12.2 Examples ........................................................   32
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. 1.5                               - ii -                            7/29/94
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.                                    FSave
  204.  
  205.  
  206. 1.  Preface
  207.  
  208.      Filesaves are a necessary evil on nearly all computer systems.  Neces-
  209. sary  because  all systems (be it the hardware, the software, or the opera-
  210. tor) eventually fail resulting in loss of  information,  and  evil  because
  211. they  are  usually a pain in the neck to do.  The problem is that filesaves
  212. must be done frequently, but are only  needed  infrequently.   The  natural
  213. human  tendency in this type of situation is to put them off, but then when
  214. the failure occurs you don't have the up-to-date  filesave  that  can  save
  215. you.
  216.  
  217.      FSave is a program designed specifically for PC-type  systems  running
  218. either  DOS  or Windows that simplifies the task of creating filesaves.  It
  219. does this by saving only that information that  cannot  be  recovered  from
  220. other  sources.   The  result is that your periodic filesaves are quick and
  221. easy, and do not require expensive backup hardware (tape drives)  or  media
  222. (tapes).  By making filesaves less onerous, FSave makes it more likely that
  223. you will do periodic filesaves more frequently than  you  otherwise  would,
  224. for which you will be eternally grateful when your hard disk has crashed or
  225. you have lost data for another reason.
  226.  
  227.      Note that FSave itself does not do the actual archiving.  Instead,  it
  228. creates  files  containing  lists  of the names of the files that should be
  229. saved, and then invokes your favorite compressor/archiver program to do the
  230. grungy  work.   If your favorite archiver can be told to read a file to get
  231. the list of filenames to save, you can use it with FSave.  This  eliminates
  232. most  religious  arguments about the merits of the various compression pro-
  233. grams that are available.
  234.  
  235. 1.1.  Printing this Document
  236.  
  237.      If you wish to print this manual, you will get  the  best  results  by
  238. using  an editor that prints exactly 66 lines per page.  Of course, you can
  239. read it into a word processor and fiddle with it if have the time.
  240.  
  241. 1.2.  Preface to the Shareware Version
  242.  
  243.      The shareware version of FSave is missing some of the  features  found
  244. in  the registered version.  These missing features do not cripple the pro-
  245. gram or impair its basic functionality, so you will be able to  fully  test
  246. FSave to get a feel for how it works and whether you like it.  The disabled
  247. features are what you might call "convenience features:" they don't perform
  248. any vital functions but they do make the program easier to use.
  249.  
  250.      This document describes the registered version of FSave.   The  symbol
  251. ($$$)  is used to identify features which are missing in the shareware ver-
  252. sion.  Note that this symbol is not a part of any command or  keyword  with
  253. which  it  appears; it simply flags something that has been disabled in the
  254. shareware version.
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261. 1.5                                - 1 -                            7/29/94
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.                                    FSave
  270.  
  271.  
  272. 1.3.  DISCLAIMER
  273.  
  274.      FSave is supplied as is.  The author disclaims any and all warranties,
  275. expressed or implied, including but not limited to warranties of merchanta-
  276. bility and of fitness for any purpose.  The author assumes  no  liabilities
  277. for  any damages, direct or consequential, which may result from the use of
  278. FSave.
  279.  
  280. 2.  Installation
  281.  
  282.      Installation is easy, as there are only two files to copy.
  283.  
  284. 2.1.  Where Do I Put It?
  285.  
  286.      FSave can be put in a directory of its own, but it is more  convenient
  287. to  put  it  in  a  directory that is on your "PATH" because it can then be
  288. invoked without having to type its entire pathname.  The installation  pro-
  289. cedure  below assumes that you will be installing it in the "c:\dos" direc-
  290. tory.  If you wish to put it somewhere  else,  modify  the  commands  below
  291. accordingly.
  292.  
  293. 2.2.  Installing FSave
  294.  
  295.      Follow these steps to install FSave:
  296.  
  297. (1)  Copy FSave into your "dos" directory with these commands:
  298.  
  299.          copy a:fsave.exe c:\dos\fsave.exe
  300.          copy a:fsave.ini c:\dos\fsave.ini
  301.  
  302.      The "fsave.ini" file contains commands that  use  "pkzip"  to  do  the
  303.      archiving;  if you wish to use another archiver, you must modify these
  304.      entries.  I suggest that you test FSave with  "pkzip"  first;  if  you
  305.      like it, then invest the time to customize the initialization file.
  306.  
  307. (2)  Create a temporary directory called "c:\tmp".   This  is  where  FSave
  308.      will  write  its lists of filenames and other reports.  If you already
  309.      have   a   temporary   directory   of   a   different    name,    edit
  310.      "c:\dos\fsave.ini"  and  wherever  "c:\tmp"  appears, change it to the
  311.      name of your temporary directory.
  312.  
  313. (3)  The next step is to create configuration files in your directories  to
  314.      indicate  what  should  be  saved  and  what should be skipped in each
  315.      directory.  Configuration files are completely described later in this
  316.      manual; the next chapter will get you started.
  317.  
  318. 3.  A Quick Start
  319.  
  320. 3.1.  Who Should Read This Chapter?
  321.  
  322.      For the impatient types who would rather be doing something than read-
  323. ing  about  how  to  do  it,  here are some instructions to get you started
  324. quickly.  But this glimpse of FSave's operation provides a good context  in
  325.  
  326.  
  327. 1.5                                - 2 -                            7/29/94
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.                                    FSave
  336.  
  337.  
  338. which  to understand the remainder of this manual, so this chapter is worth
  339. reading even if you are the more patient type who does not need to see your
  340. machine busy doing something 24 hours a day.
  341.  
  342.      These instructions assume that  you  have  "pkzip"  version  2.04g  or
  343. later,  and that it is stored in a directory listed in your "PATH".  If you
  344. do not have "pkzip" but would like it, it is available  in  shareware  form
  345. from  many bulletin boards and ftp sites.  If you prefer to use a different
  346. archiving/compressing program, you will need  to  modify  the  commands  in
  347. "fsave.ini" to invoke your chosen program.
  348.  
  349. 3.2.  Step By Step Instructions
  350.  
  351. (1)  Create a "configuration" file called "c:\fsave.cnf", containing  these
  352.      lines:
  353.  
  354.          DateAll = date
  355.          SkipDirs = directory names
  356.          SkipFiles = file names
  357.  
  358.      In the first line, enter the date you purchased your  system  (or  the
  359.      date  you loaded your first software package) for the word "date".  In
  360.      the second line, type the names of  all  subdirectories  in  the  root
  361.      directory  that  you  do  NOT want to back up.  This would include any
  362.      temporary directories that do not contain any files of lasting  value,
  363.      and  subdirectories that contain only files that can be recovered from
  364.      other sources.  This usually includes the "c:\tmp" directory.  On  the
  365.      third  line,  type the names of any files in the root directory you do
  366.      not wish to back up.  These would include files that contain no useful
  367.      information  (e.g.  the  Windows  swap  file,  though this is normally
  368.      skipped because it is a hidden file), or files that can  be  recovered
  369.      from  other  sources.   If  there  are none, the entry may be omitted.
  370.      Here is a typical root configuration file:
  371.  
  372.          DateAll = 1/1/93
  373.          SkipDirs = recovery tmp video bin
  374.  
  375.      There are more things that may be specified  in  configuration  files,
  376.      and they are fully covered in section 5.
  377.  
  378.      One final note: only files and directories in  the  current  directory
  379.      may  be  mentioned  in  a configuration file.  To skip files or direc-
  380.      tories contained in another directory, another configuration  file  is
  381.      created  in  that  directory.   For  example,  to specify skipping the
  382.      "windows\system" directory, "c:\windows\fsave.cnf" would  include  the
  383.      line
  384.  
  385.          SkipDirs = system
  386.  
  387.  
  388. (2)  Now change to the root directory and do a test-mode save, like this:
  389.  
  390.          cd c:\
  391.  
  392.  
  393. 1.5                                - 3 -                            7/29/94
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.                                    FSave
  402.  
  403.  
  404.          fsave /t
  405.  
  406.      FSave will look through your entire "c:" drive (except the things  you
  407.      have  told it to skip) to find all files that were last modified on or
  408.      after the date you specified in your configuration file.   A  list  of
  409.      these  filenames  will be written to the file "c:\tmp\saved.txt"; each
  410.      line of this file includes the size, modification date, and name of  a
  411.      file that would be backed up.
  412.  
  413.      Examine this list to find files that should not be backed up; any file
  414.      that  you can recover from any other source (bulletin board, distribu-
  415.      tion diskette, master backup of that directory, etc.) need  be  backed
  416.      up  only  if  your file is newer than the version on the other source.
  417.      In each directory containing files or directories  that  need  not  be
  418.      saved, create a configuration file called "fsave.cnf" containing lines
  419.      such as those shown above.  Note that the entries in  a  configuration
  420.      file  are  all optional; those that are not needed may be omitted.  If
  421.      all the entries are omitted, no configuration file is needed.
  422.  
  423.      The first thing to look for in each directory is  whether  a  specific
  424.      date  marks  the  beginning  of the files to be saved.  If so, specify
  425.      this date with "DateAll" in the directory's configuration file.  Then,
  426.      if  there  are  subdirectories that should not be backed up, add their
  427.      names to the "SkipDirs" entry in the configuration file.  Finally, add
  428.      the  names of specific files that need not be saved to the "SkipFiles"
  429.      entry.
  430.  
  431. (3)  After   doing   this   for   each   directory   that    appeared    in
  432.      "c:\tmp\saved.txt", do another test save just like the first one.  The
  433.      "saved.txt" file will be recreated, and you can  see  the  results  of
  434.      your  efforts.   If you find additional files or directories that need
  435.      not be saved, add or modify the  appropriate  configuration  files  as
  436.      needed to skip them.
  437.  
  438. (4)  When you have eliminated everything that can be eliminated, do a  real
  439.      filesave.   The  quick  start initialization file specifies "pkzip" to
  440.      create the backup files on "a:".  If this is not appropriate for  your
  441.      system,  modify  the entries in "c:\dos\fsave.ini" as needed (you will
  442.      need to look ahead to other sections of this manual to figure out what
  443.      is needed).  Then get a bunch of blank diskettes ready.  How many will
  444.      you need?  That depends on what compression program you are using, and
  445.      the  specific  contents  of the files you are saving.  With "pkzip", I
  446.      regularly save 3 megabytes of information on a  single  1.44  megabyte
  447.      diskette.  Start the filesave by typing
  448.  
  449.          cd c:\
  450.          fsave
  451.  
  452.      FSave creates one or more lists of files to be saved, and writes these
  453.      lists  to "a:" for future use as a table of contents.  It then invokes
  454.      "pkzip" to compress the files themselves to "a:".  The  initialization
  455.      file  provided  specifies the "pkzip" option that continues a zip file
  456.      on another diskette if the current one should fill up.
  457.  
  458.  
  459. 1.5                                - 4 -                            7/29/94
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.                                    FSave
  468.  
  469.  
  470. (5)  That's it - you've backed up your system.  If your system is  anything
  471.      like mine, you needed to back up only a few megabytes out of many tens
  472.      or perhaps hundreds of megabytes of stuff on your hard disk.
  473.  
  474. (6)  The hope is that you will never to restore files from a backup, but if
  475.      the  worst  happens  you will be prepared.  After a failure, you would
  476.      reload your operating system and all of your  purchased  or  shareware
  477.      software  from their original media.  Then you would restore the files
  478.      FSave had saved to recover all of the information you had modified.
  479.  
  480. 4.  Design Philosophy
  481.  
  482. 4.1.  Why FSave?
  483.  
  484.      The are two main problems with doing filesaves  on  PC  systems.   The
  485. first is the large size of modern hard disks.  Backing up a several hundred
  486. megabyte hard disk to 1.44 megabyte floppies  is  just  not  practical;  it
  487. could  easily  take  a hundred or more diskettes, not to mention many, many
  488. hours to do.
  489.  
  490.      The second problem is the price of tape backup hardware.  Not everyone
  491. is  willing  to spend a couple of hundred dollars for a tape system capable
  492. of holding an entire hard disk's  data.   Just  the  tapes  themselves  can
  493. become  a  considerable expense.  This is a high price to pay for something
  494. that, like insurance, you hope you never have to use.
  495.  
  496. 4.2.  FSave Design Principles
  497.  
  498.      FSave was designed around three basic principles.  The first  is  sim-
  499. ple:
  500.  
  501.     If it is not quick and easy to do filesaves, you will do them  less
  502.     often than you should, maybe never.
  503.  
  504.  
  505. This fact of human nature is the challenge that FSave addresses:  it  makes
  506. filesaves much quicker and easier.
  507.  
  508.      How is this done?  Quite simply, by not saving everything on the  hard
  509. disk.  The second basic principle is this:
  510.  
  511.     You will keep the media from which commercial or other software was
  512.     originally obtained.
  513.  
  514.  
  515. The importance of this is easily explained: any files on your  system  that
  516. are  unchanged  since they were first installed need not be backed up regu-
  517. larly because they can be recovered from the original installation media.
  518.  
  519.      This is perhaps the one that is most likely to cause problems, but  is
  520. also  easily  remedied.   Programs  downloaded  from bulletin boards or ftp
  521. sites are often installed and then the downloaded file  is  discarded.   If
  522. you  can retrieve the program again later, then there is no problem (though
  523.  
  524.  
  525. 1.5                                - 5 -                            7/29/94
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.                                    FSave
  534.  
  535.  
  536. keeping a list of which programs you have gotten and  where  you  got  them
  537. from  will  simplify this task).  If for some reason you cannot get another
  538. copy of some program on your system, simply archive that  entire  directory
  539. to  a  diskette  (or  set of diskettes) and label that as a "master backup"
  540. (described more fully in a later chapter).  Now, only those files that have
  541. changed since you created this backup need be saved regularly.
  542.  
  543.      The drawback to this approach is that restoring files after a crash is
  544. more time consuming.  First, your operating system must be reloaded.  Then,
  545. all your packages must be reloaded from  their  original  media  or  master
  546. backups.   Finally,  your  modified  files  are reloaded from your filesave
  547. diskettes.  It is the third and final principle that makes this palatable:
  548.  
  549.     You will be backing your system up far more often than you will  be
  550.     restoring it.
  551.  
  552.  
  553. If this is not true of your system, FSave is not for you,  but  you  should
  554. seriously  consider  getting  a more reliable system.  But if, like me, you
  555. have never had a hardware problem (knock on  wood!)  and  need  to  restore
  556. files primarily due to occasional operator stupidity, then FSave will serve
  557. your needs perfectly.
  558.  
  559. 5.  Understanding Configurations
  560.  
  561. 5.1.  Overview of Operation
  562.  
  563.      FSave does a simple job:
  564.  
  565. (1)  it decides which files on your system need to be backed up,  based  on
  566.      information obtained from your configuration files;
  567.  
  568. (2)  it writes the names of these files to one or more files in a temporary
  569.      directory; and
  570.  
  571. (3)  it invokes a compressor/archiver program such as "pkzip"  to  actually
  572.      save the files in each list to a diskette or other destination.
  573.  
  574. 5.2.  Configurations
  575.  
  576.      The foundation underlying this  process  is  the  "configuration";  it
  577. specifies  which  files to save and which to skip, and which directories to
  578. process and which to ignore.
  579.  
  580. 5.2.1.  Global and Local Configurations
  581.  
  582.      There are two  configurations,  the  "global  configuration"  and  the
  583. "local configuration." Only the local configuration determines what to save
  584. and what to skip in a directory; the local configuration gets  its  initial
  585. values from the global configuration.
  586.  
  587.      Here is exactly how this is done.  When FSave enters a  new  subdirec-
  588. tory,  the  local  and  global  configurations  for that directory are both
  589.  
  590.  
  591. 1.5                                - 6 -                            7/29/94
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.                                    FSave
  600.  
  601.  
  602. initialized from the parent directory's global configuration.   The  confi-
  603. guration  file,  if one exists in the directory, is then read; its contents
  604. may modify the local or global configuration.  Modifications to  the  local
  605. configuration affect decisions about whether files in this directory should
  606. be saved or skipped.  Modifications  to  the  global  configuration  affect
  607. decisions about files in subdirectories of this directory.
  608.  
  609. 5.2.2.  Elements of a Configuration
  610.  
  611.      The local and global configurations contain the same things: one date,
  612. and  six  lists  of  file  names or filename patterns.  The date determines
  613. which files will be skipped; files whose  modification  times  are  earlier
  614. than this date are not saved.
  615.  
  616.      There are six filename lists that specify:
  617.  
  618. (1)  files to save,
  619.  
  620. (2)  files to skip,
  621.  
  622. (3)  files to delete,
  623.  
  624. (4)  files that should not be reported if they have been modified but  were
  625.      not saved,
  626.  
  627. (5)  subdirectories to process, and
  628.  
  629. (6)  subdirectories to skip.
  630.  
  631. The   redundant   specification   of   files/directories   to   save    and
  632. files/directories  to skip makes configuration files easier to write; some-
  633. times it is more straightforward to list a few files to skip than it is  to
  634. list all of the files to save.  However, the redundancy allows for contrad-
  635. ictory specifications: what if the same name appears on the list  of  files
  636. to  save  and  the list of files to skip?  To eliminate this ambiguity, the
  637. "skip" lists take precedence over the "save" lists; a complete  description
  638. of  the  manner in which the configuration is processed is given in a later
  639. chapter.
  640.  
  641. 5.2.3.  Configuration Files
  642.  
  643.      Every directory may contain  a  configuration  file,  though  this  is
  644. rarely  needed because of the inheritance of configurations from the parent
  645. directory.  Configuration files are usually named "fsave.cnf", but this may
  646. be  modified  through  a command line option.  Whatever their names, confi-
  647. guration files all contain one or more entries of the form:
  648.  
  649.     keyword = values
  650.  
  651. The following keywords are provided:
  652.  
  653.  
  654.  
  655.  
  656.  
  657. 1.5                                - 7 -                            7/29/94
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.                                    FSave
  666.  
  667.  
  668.                Date                  DateAll
  669.                SaveFiles             SaveAllFiles
  670.                SaveDirs              SaveAllDirs
  671.                SkipFiles             SkipAllFiles
  672.                SkipDirs              SkipAllDirs
  673.                DeleteFiles ($$$)     DeleteAllFiles ($$$)
  674.                IgnoreUnsaved ($$$)   IgnoreAllUnsaved ($$$)
  675.  
  676. Each entry must be on its own line.  Lines beginning with a "#"  and  blank
  677. lines  are  all  ignored  as comments.  Configuration file entries are read
  678. without regard to capitalization, so "SaveFiles", "savefiles", "SAVEFILES",
  679. and "SaVeFiLeS" are all equivalent.
  680.  
  681.      Keywords listed in the left column above affect only the local  confi-
  682. guration;  those  in  the right column affect both the local and the global
  683. configurations.  Because of this, the "All" entries usually appear first in
  684. configuration files, followed by the other entries.
  685.  
  686.      Date entries may be given in either of these forms:
  687.  
  688.     Date = mm/dd/yy
  689.     Date = mm/dd/yyyy
  690.  
  691. Two-digit years 80-99 are interpreted as 1980-1999, with 00-79 being inter-
  692. preted as 2000-2079.  Four digits may be used to specify any year from 1980
  693. to 2108, the range of dates allowed by MS-DOS.
  694.  
  695.      The values for all other entries are given as a list of zero  or  more
  696. (yes,  the  list may be empty) Unix-style filename patterns, separated from
  697. each other by one or more spaces and/or tabs.   These  Unix-style  patterns
  698. are more powerful than MS-DOS filename patterns, and are fully explained in
  699. the last chapter.  It suffices here to say that most MS-DOS  patterns  will
  700. work  exactly  as you expect them to; the major incompatibility is with the
  701. "?" character, which in a Unix-style pattern  always  matches  exactly  one
  702. character.
  703.  
  704.      Of course, full filenames and directory names may  also  be  given  in
  705. filename  lists.  However, the entries in a configuration refer only to the
  706. files and subdirectories contained in that directory, so filenames or  pat-
  707. terns containing "\" will have no effect and should not be used.
  708.  
  709.      With all except the Date entries, the "=" may be replaced with  either
  710. "+"  or  "-".   Using "=" sets the list to the given values, using "+" adds
  711. the given values to the list, and using "-" removes the given values to the
  712. list.  Adding something that is already on a list has no effect, and trying
  713. to remove something that is not on a list is silently ignored.
  714.  
  715.      Finally, a configuration file may contain  several  entries  with  the
  716. same  keyword, and the entries in a configuration file are processed in the
  717. order in which they appear.  This means that
  718.  
  719.     SaveAllFiles = *.cpp
  720.  
  721.  
  722.  
  723. 1.5                                - 8 -                            7/29/94
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.                                    FSave
  732.  
  733.  
  734.     SaveAllFiles + *.h
  735.  
  736. has the same effect as
  737.  
  738.     SaveAllFiles = *.cpp *.h
  739.  
  740. But be careful, if you do this:
  741.  
  742.     SaveAllFiles = *.cpp
  743.     SaveAllFiles = *.h
  744.  
  745. the second entry replaces the value set by the first entry.
  746.  
  747. 5.3.  Common Configuration Problems
  748.  
  749.      Here are some common mistakes that people make in configuration files.
  750.  
  751. (1)  The All entries modify both the global and local configurations, which
  752.      leads to this common error:
  753.  
  754.          SaveFiles = *.exe
  755.          SaveAllFiles = *.txt
  756.  
  757.      In this example, the first line does not accomplish anything.  It sets
  758.      the  local configuration, but the second line also sets the local con-
  759.      figuration, replacing the value given in the first  line.   The  solu-
  760.      tion:  put  the All entries before other entries in your configuration
  761.      files.
  762.  
  763. (2)  Using the equal sign replaces the old list with  the  newly  specified
  764.      list.   For example, if the configuration file in the parent directory
  765.      specified a bunch of different kinds of files to save, the  configura-
  766.      tion
  767.  
  768.          SaveFiles = *.exe
  769.  
  770.      discards all of that and specifies that only  files  ending  with  exe
  771.      should  be  saved.  If that is really what you want, there is no prob-
  772.      lem.  If what you wanted to do was to _a_d_d this to the  list  given  in
  773.      the parent directory, this is not the way to do it.  The solution: use
  774.      the plus to add new things to an existing list.
  775.  
  776. 5.4.  An Example
  777.  
  778.      The listings and  files  below  come  from  my  own  system,  and  are
  779. presented  as an example of one way that FSave can be used.  To keep things
  780. to a manageable size, only a subset of my whole disk is shown.  The  direc-
  781. tory listings were all made with the command
  782.  
  783.     "dir/o:d"
  784.  
  785. which orders the entries by their date.
  786.  
  787.  
  788.  
  789. 1.5                                - 9 -                            7/29/94
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.                                    FSave
  798.  
  799.  
  800.      The root directory looks like this:
  801.  
  802.      Directory of C:\
  803.  
  804.     WINA20   386      9349 05-09-91  12:00p
  805.     RECOVERY     <DIR>     08-25-92  12:00p
  806.     DOS          <DIR>     08-25-92  12:00p
  807.     PS1TOOLS     <DIR>     08-25-92  12:00p
  808.     WINDOWS      <DIR>     08-25-92  12:00p
  809.     MSWORKS      <DIR>     08-25-92  12:00p
  810.     QUICKENW     <DIR>     01-24-93  11:03a
  811.     BIN          <DIR>     02-02-93   6:02p
  812.     USR          <DIR>     06-07-93   9:56a
  813.     SRC          <DIR>     12-24-93   3:33p
  814.     CONFIG   SYS       191 12-30-93   3:06p
  815.     PROFILE  SH        387 01-22-94   9:59p
  816.     VIDEO        <DIR>     01-29-94   8:17a
  817.     BC4          <DIR>     05-19-94  10:59a
  818.     AUTOEXEC BAT       759 05-19-94  11:40a
  819.     FSAVE    CNF       109 05-20-94   6:45a
  820.     TMP          <DIR>     05-28-94   7:57a
  821.  
  822. My configuration in this directory looks like this:
  823.  
  824.     DateAll = 1/1/93
  825.     SkipDirs = recovery tmp video
  826.     IgnoreUnsaved = 386spart.par
  827.  
  828. I chose the date because that is when I purchased  the  system;  everything
  829. that was on the system when I bought it can be recovered from the diskettes
  830. that came with it, so there is no need to back up any of it.  I do not back
  831. up  the directories "recovery" and "video" because they do not contain any-
  832. thing that ever changes.  I do not back up the directory  "tmp"  because  I
  833. never  put  anything of lasting value in it; that is my "scratchpad" direc-
  834. tory.
  835.  
  836.      Let's look  next  at  the  "QUICKENW"  directory,  which  contains  an
  837. installed package.
  838.  
  839.      Directory of C:\QUICKENW
  840.  
  841.     HMXPORT  DLL      8256 11-13-92  10:17a
  842.     QDDE     XLS      4898 11-13-92  10:18a
  843.     QDDE     WK3      9651 11-13-92  10:18a
  844.     INTELLIC CAT     12619 09-07-93  12:00a
  845.     QCHECK   EXE      9344 09-07-93  12:00a
  846.     CCT100   DLL    222032 09-07-93  12:00a
  847.     QWPR     DLL    253696 11-03-93   2:51p
  848.     WPRINTCK EXE     61718 12-09-93  12:00a
  849.     QW       EXE   2256256 12-09-93  10:47a
  850.     QW       HLP   1561240 12-09-93  10:47a
  851.     QOWPR    DLL    252000 12-09-93  10:48a
  852.     QOFONT   FON      4096 12-09-93  10:48a
  853.  
  854.  
  855. 1.5                               - 10 -                            7/29/94
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.                                    FSave
  864.  
  865.  
  866.     BACKUP       <DIR>     05-01-94  10:12a
  867.     FSAVE    CNF        20 06-06-94   9:53p
  868.     QDATA    QNX     92982 07-27-94   9:12a
  869.     QDATA    QDI      5192 07-27-94   9:12a
  870.     QDATA    QDT    484736 07-27-94   9:14a
  871.     QDATA    QMT     31236 07-27-94   9:14a
  872.  
  873. This is not a complete listing, but is enough to be representative.  When I
  874. installed  this  package,  the  latest  date appearing in the directory was
  875. 12/9/93.  Therefore, the configuration file in this directory contains only
  876. this line:
  877.  
  878.     DateAll = 12/10/93
  879.  
  880. This prevents anything from  the  original  installation  (which  could  be
  881. recovered  by  re-installing  the package) from being backed up.  Any files
  882. that are _m_o_d_i_f_i_e_d will have dates later than this, and they will be  backed
  883. up.
  884.  
  885.      In the preceding example, the "QUICKENW" directory  contained  a  sub-
  886. directory called "BACKUP".  Its contents are shown below:
  887.  
  888.      Directory of C:\QUICKENW\BACKUP
  889.  
  890.     FSAVE    CNF        18 05-01-94  10:14a
  891.     QDATA1   QNX     92982 07-27-94   9:12a
  892.     QDATA1   QDT    484736 07-27-94   9:12a
  893.     QDATA1   QMT     31236 07-27-94   9:12a
  894.     QDATA1   QDI      5192 07-27-94   9:12a
  895.     QDATA1   QST     39505 07-27-94   9:12a
  896.  
  897. Quicken periodically copies its data files to this directory  as  a  safety
  898. measure.   I  don't particularly like this, as I back the files up to flop-
  899. pies as often as I think is necessary; as  far  as  I  am  concerned,  this
  900. backup  directory  simply  wastes disk space.  Therefore, the configuration
  901. file in this directory specifies this:
  902.  
  903.     DeleteFiles = *.q*
  904.  
  905. so that FSave will automatically delete all the quicken files in the backup
  906. directory.
  907.  
  908.      Here is one final directory, called "SRC"; this is where  I  keep  the
  909. source code to programs that I write (such as FSave).
  910.  
  911.      Directory of C:\SRC
  912.  
  913.     CRYPTO       <DIR>     01-04-94   8:32p
  914.     UTILITY      <DIR>     01-05-94   8:01p
  915.     FINDSYM  SH        270 01-30-94  11:40a
  916.     WENSCRIP     <DIR>     02-20-94   6:26a
  917.     TIMECLK      <DIR>     02-25-94   1:34p
  918.     DU           <DIR>     02-27-94  12:50p
  919.  
  920.  
  921. 1.5                               - 11 -                            7/29/94
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.                                    FSave
  930.  
  931.  
  932.     LIB          <DIR>     03-03-94   7:38a
  933.     BC4ERRAT TXT       241 04-08-94   5:34p
  934.     CLASSLIB     <DIR>     04-24-94   2:40p
  935.     FSAVE        <DIR>     04-30-94  10:51a
  936.     CLEANSRC SH       1062 06-28-94   6:21p
  937.     FSAVE    CNF       126 06-28-94   6:21p
  938.  
  939. The configuration file for this directory contains these entries:
  940.  
  941.     SkipAllFiles = *.dsw *.exe
  942.     DeleteAllFiles = *.~* *.obj *.csm *.bak
  943.     DeleteAllFiles + *.map *.rws *.res *.obr
  944.     IgnoreAllUnsaved = *.dsw
  945.  
  946. Files with extensions "dsw" and "exe" are not backed up; the former are not
  947. terribly  important,  and  can be recreated with little trouble if they are
  948. lost.  The latter are executable programs.  The only executables  in  these
  949. directories  are  the  ones  generated  from the source code, so they exist
  950. there only while being tested.
  951.  
  952.      A large number of file types are deleted: these are all  backup  files
  953. created  by the compiler, or things such as object code or linker maps that
  954. have no long-term value.  Finally, the last entry specifies that the  "dsw"
  955. files  which were skipped should not be reported in the "unsaved.txt" file,
  956. as I don't care about them anyway.
  957.  
  958.      A test-mode filesave  on  these  directories  produced  the  following
  959. results.   Again, I have deleted many entries, especially those from direc-
  960. tories other than the ones discussed above, but have left enough to show  a
  961. representative sampling.  The following files were selected to be saved:
  962.  
  963.           191 12/30/93 CONFIG.SYS
  964.           387 01/22/94 PROFILE.SH
  965.         1,371 07/27/94 HISTORY.SH
  966.           109 05/20/94 FSAVE.CNF
  967.           759 05/19/94 AUTOEXEC.BAT
  968.        92,982 07/27/94 QUICKENW\QDATA.QNX
  969.       484,736 07/27/94 QUICKENW\QDATA.QDT
  970.        31,236 07/27/94 QUICKENW\QDATA.QMT
  971.         5,192 07/27/94 QUICKENW\QDATA.QDI
  972.            20 06/06/94 QUICKENW\FSAVE.CNF
  973.            18 05/01/94 QUICKENW\BACKUP\FSAVE.CNF
  974.           241 04/08/94 SRC\BC4ERRAT.TXT
  975.         1,062 06/28/94 SRC\CLEANSRC.SH
  976.           270 01/30/94 SRC\FINDSYM.SH
  977.           126 06/28/94 SRC\FSAVE.CNF
  978.           718 06/25/94 SRC\FSAVE\PERRNO.CPP
  979.           411 06/25/94 SRC\FSAVE\PERRNO.H
  980.         9,592 07/27/94 SRC\FSAVE\FSAVE.CPP
  981.         1,380 05/20/94 SRC\FSAVE\CONFIG.H
  982.         7,862 07/27/94 SRC\FSAVE\CONFIG.CPP
  983.        77,206 07/27/94 SRC\FSAVE\FSAVE.IDE
  984.        (and many more)
  985.  
  986.  
  987. 1.5                               - 12 -                            7/29/94
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.                                    FSave
  996.  
  997.  
  998.     354 files (2,921,018 bytes) to be saved.
  999.  
  1000. The following files would have been deleted:
  1001.  
  1002.        92,982 QUICKENW\BACKUP\QDATA1.QNX
  1003.       484,736 QUICKENW\BACKUP\QDATA1.QDT
  1004.        31,236 QUICKENW\BACKUP\QDATA1.QMT
  1005.         5,192 QUICKENW\BACKUP\QDATA1.QDI
  1006.        39,505 QUICKENW\BACKUP\QDATA1.QST
  1007.         9,556 SRC\FSAVE\FSAVE.BAK
  1008.         7,883 SRC\FSAVE\CONFIG.BAK
  1009.     2,128,147 SRC\FSAVE\FSAVE.CSM
  1010.        78,074 SRC\FSAVE\FSAVE.~DE
  1011.        64,598 SRC\FSAVE\CONFIG.OBJ
  1012.        75,608 SRC\FSAVE\FSAVE.OBJ
  1013.        13,389 SRC\FSAVE\PERRNO.OBJ
  1014.       112,021 SRC\FSAVE\FSAVE.MAP
  1015.       (and many more)
  1016.     31 files (6,283,049 bytes) to be deleted.
  1017.  
  1018. The quicken backup files would be zapped, as well as over  5  megabytes  of
  1019. other  garbage.   Finally, the following files were reported as having been
  1020. modified yet not saved:
  1021.  
  1022.       115,608 07/27/94 SRC\FSAVE\FSAVE.EXE
  1023.        42,496 07/18/94 SRC\WENSCRIP\WENSCRIP.EXE
  1024.     2 modified files unsaved.
  1025.  
  1026. These executables in the source directory exist only for testing,  so  they
  1027. do  not  concern  me.   If I wanted, I could add the pattern "*.exe" to the
  1028. "IgnoreAllUnsaved" line in the  "SRC"  directory's  configuration  file  to
  1029. eliminate these messages.
  1030.  
  1031. 6.  FSave Operation
  1032.  
  1033. 6.1.  Initialization
  1034.  
  1035.      When FSave begins,  it  first  reads  an  initialization  file  called
  1036. "fsave.ini".   This  file contains several things that affect the operation
  1037. of FSave, for example,
  1038.  
  1039. (1)  the command to invoke to actually save a list of files, and
  1040.  
  1041. (2)  the directory in which to write lists of filenames.
  1042.  
  1043. The format of the initialization file is completely described later in this
  1044. chapter.
  1045.  
  1046.      FSave then  reads  its  command-line  arguments.   These  may  contain
  1047. options  that  select different modes of operation or modify how configura-
  1048. tions are interpreted.  The options are followed by zero or more  directory
  1049. names,  these are specific subdirectories in which to begin working.  If no
  1050. directory names are given, work  begins  in  the  current  directory.   The
  1051.  
  1052.  
  1053. 1.5                               - 13 -                            7/29/94
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.                                    FSave
  1062.  
  1063.  
  1064. available options are completely described later in this chapter.
  1065.  
  1066.      FSave then sets the local and global configuration  to  the  following
  1067. default values:
  1068.  
  1069.                        DateAll            = 1/1/1980
  1070.                        SaveAllFiles       = *
  1071.                        SaveAllDirs        = *
  1072.                        SkipAllFiles       =
  1073.                        SkipAllDirs        =
  1074.                        DeleteAllFiles     =
  1075.                        IgnoreAllUnsaved   =
  1076.  
  1077. This will save all files on the disk, as 1/1/1980 is the earliest date that
  1078. MS-DOS can store on a file.
  1079.  
  1080.      Normal processing now begins;  it  consists  of  the  following  three
  1081. steps:
  1082.  
  1083. (1)  If a configuration file is found in the current directory, read it.
  1084.  
  1085. (2)  Process each file found in the current directory.
  1086.  
  1087. (3)  Recursively process each subdirectory found in the current directory.
  1088.  
  1089. 6.2.  Processing Files
  1090.  
  1091.      "Processing" a file is simply comparing its name and modification date
  1092. to  the local configuration to decide whether it should be saved.  Here are
  1093. the steps in this process:
  1094.  
  1095. (1)  If the name matches any pattern in the "DeleteFiles" list, the file is
  1096.      deleted.
  1097.  
  1098. (2)  If the modification date of the file is older  than  the  "Date",  the
  1099.      file is skipped (i.e. not saved).
  1100.  
  1101. (3)  If the filename matches anything on the "SkipFiles" list, the file  is
  1102.      skipped.
  1103.  
  1104. (4)  If the filename does not match anything on the "SaveFiles"  list,  the
  1105.      file is skipped.
  1106.  
  1107. (5)  If the file has not been deleted or skipped, its name is added to  the
  1108.      list of files to be saved.
  1109.  
  1110.      The default configuration makes use of one common strategy of specify-
  1111. ing files to be saved: the "Save" list says to save everything, and we rely
  1112. on the "Skip" list to omit those files we do not want.  The other  strategy
  1113. is  for  the "Save" list to enumerate only those files we want saved; some-
  1114. times this is easier to specify.
  1115.  
  1116.  
  1117.  
  1118.  
  1119. 1.5                               - 14 -                            7/29/94
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.                                    FSave
  1128.  
  1129.  
  1130. 6.3.  Processing Subdirectories
  1131.  
  1132.      After the files in a directory have been completed, the subdirectories
  1133. are  processed.   "Processing"  a  subdirectory  involves matching its name
  1134. against the configuration; FSave enters each directory that is not  skipped
  1135. and processes its contents recursively (that is, in the same way that first
  1136. directory was processed).
  1137.  
  1138.      Here are the steps followed for a subdirectory:
  1139.  
  1140. (1)  If the subdirectory name matches anything on the "SkipDirs"  list,  it
  1141.      is skipped.
  1142.  
  1143. (2)  If the subdirectory name does not match  anything  on  the  "SaveDirs"
  1144.      list, it is skipped.
  1145.  
  1146. (3)  If the subdirectory has not been skipped, then it is recursively  pro-
  1147.      cessed.
  1148.  
  1149.      Directories that are "skipped" are truly ignored by FSave.   It  makes
  1150. no difference whether they contain configuration files that specify work to
  1151. be done; if they are skipped, these configuration  files  are  never  acted
  1152. upon.
  1153.  
  1154. 6.4.  Output Files
  1155.  
  1156.      FSave writes all of its output files in the temporary directory speci-
  1157. fied in the initialization file.  These files include the following:
  1158.  
  1159. fsave1.txt, fsave2.txt, etc.
  1160.      These files contain lists of the names of files that need to be saved.
  1161.      There  may  be  many  of them because some archiving programs impose a
  1162.      limit on the size of list files.  When the current list  file  exceeds
  1163.      the  "FileSize" given in the initialization file, then FSave closes it
  1164.      and begins the next sequentially numbered list file.
  1165.  
  1166. saved.txt
  1167.      When operating in "test mode", FSave creates one large list file  that
  1168.      also  includes  the  size and modification date of each file.  Examine
  1169.      this file to see what is going to be backed up; this is the first step
  1170.      in figuring out appropriate configurations.
  1171.  
  1172. unsaved.txt
  1173.      If enabled in the initialization file, FSave will record in this  file
  1174.      the  names,  dates  and sizes of all files whose archive bit is on but
  1175.      that were not saved.  This is a dangerous combination  -  the  archive
  1176.      bit  shows  that  the  file  has been modified, therefore it cannot be
  1177.      recovered from the installation media, yet it was not saved.  This may
  1178.      indicate  that  the  configuration  file  needs to be changed.  On the
  1179.      other hand, there are files for which this  is  not  a  problem.   For
  1180.      example,  object  files  produced by compiling source code need not be
  1181.      backed up if you have the source files.  Patterns can be added to  the
  1182.      "IgnoreUnsaved"  list  in  the  configuration  to  prevent  FSave from
  1183.  
  1184.  
  1185. 1.5                               - 15 -                            7/29/94
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.                                    FSave
  1194.  
  1195.  
  1196.      yelling about these files every time.
  1197.  
  1198.      Note that FSave does not report  unsaved/modified  files  residing  in
  1199.      directories  that  have been skipped.  To detect these, run FSave like
  1200.      this:
  1201.  
  1202.          fsave /a ($$$)
  1203.  
  1204.      (Remember that the ($$$)  symbol  denotes  features  disabled  in  the
  1205.      shareware  version.)  This  option  is described in more detail below;
  1206.      briefly, it instructs FSave look for all files whose  archive  bit  is
  1207.      set, even if they would normally not be saved or reside in directories
  1208.      that would normally be skipped.  Doing this  just  after  an  ordinary
  1209.      filesave  will produce a list of all modified but unsaved files on the
  1210.      disk.
  1211.  
  1212. deleted.txt ($$$)
  1213.      If enabled in the initialization file, FSave will record in this  file
  1214.      the  names and sizes of all files it has deleted.  This information is
  1215.      useful when running FSave in test mode after modifying  configurations
  1216.      to  ensure  that  you  have  not  been  too  aggressive  in specifying
  1217.      "DeleteFiles".
  1218.  
  1219. 6.5.  Saving the Data
  1220.  
  1221.      After creating the lists of names of files to  be  saved,  FSave  then
  1222. invokes  your  chosen  archiving/compression  program  to actually save the
  1223. files.  The current version of "pkzip" (2.04g) is unable to  process  lists
  1224. of  filenames which are longer than several thousand bytes, so FSave writes
  1225. as many short list files as needed to hold the names of all the files to be
  1226. saved.   This  causes  an irritating problem when the archives are actually
  1227. being created for backups that take more than two diskettes.  What  happens
  1228. is  that  "pkzip"  is  invoked  separately  for  each  list file, so when a
  1229. diskette becomes full, "pkzip" has no way of  knowing  how  many  diskettes
  1230. were  used  by  the  previous  archive  files.  It therefore prompts you to
  1231. insert diskette #2 _e_v_e_r_y time it needs a new diskette, which can be confus-
  1232. ing if you are not expecting it.
  1233.  
  1234.      A representative of PKWARE has informed me that the  next  version  of
  1235. "pkzip" will be able to handle much larger list files, which will make this
  1236. problem much less annoying.
  1237.  
  1238.      If you can afford the luxury of writing your backups to your hard disk
  1239. rather  than to floppy disks, this problem goes away.  In addition, restor-
  1240. ing files becomes easier as there is never any confusion as to which floppy
  1241. to insert.
  1242.  
  1243. 6.6.  The Initialization File
  1244.  
  1245.      The initialization file  specifies  values  that  affect  the  general
  1246. operation  of FSave.  By default this file is named "fsave.ini" and resides
  1247. in the same directory as "fsave.exe"; if you  prefer  to  use  a  different
  1248. name, or keep the file in a different directory, you may set an environment
  1249.  
  1250.  
  1251. 1.5                               - 16 -                            7/29/94
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.                                    FSave
  1260.  
  1261.  
  1262. variable called "FSAVE" with the absolute pathname  to  the  initialization
  1263. file.
  1264.  
  1265.      This file begins with a line containing "[fsave]" followed by  one  or
  1266. more of the following entries:
  1267.  
  1268. ConfigName = value ($$$)
  1269.      Indicates the default name of the configuration file.  If  not  given,
  1270.      the  value  fsave.cnf is used.  The extension .cnf may not be changed.
  1271.      If you prefer your configuration files to appear either first or  last
  1272.      in  a  sorted directory listing, you may use this option to modify the
  1273.      name appropriately (e.g. 000fsave.cnf).
  1274.  
  1275. ConfirmDelete = value ($$$)
  1276.      Indicates whether a confirmation is needed before  deleting  files  as
  1277.      specified  by  the  configuration.   The  value may be either "yes" or
  1278.      "no", with the default being "yes." If this option is selected,  FSave
  1279.      will  prompt  with the name of each file it is about to delete; if the
  1280.      reply does not begin with "y" or "Y" the file will not be deleted.
  1281.  
  1282. DirectoryIndex = value ($$$)
  1283.      Specifies whether an index of the files in each  directory  should  be
  1284.      created and saved along with the files.  The value may be either "yes"
  1285.      or "no", and defaults to "no."  The  directory  index  allows  you  to
  1286.      easily find what has changed in a directory since the last backup.  It
  1287.      is also useful after restoring from a backup to remove files that  had
  1288.      been  deleted  before the filesave was made.  This option is discussed
  1289.      in more detail in a later chapter.
  1290.  
  1291. Dump = (command)
  1292. IncrementalDump = (command)
  1293.      These entries are required, and specify the MS-DOS command to be  exe-
  1294.      cuted  to  archive  the  files whose names appear in a list file.  The
  1295.      name of the list file can be referenced in the  command  by  the  con-
  1296.      struct  "%list%", and the number of the list file can be referenced by
  1297.      "%number%".  The number refers to the sequence number of a list  file,
  1298.      e.g., 1 for "fsave1.txt", 2 for "fsave2.txt", etc.  The examples below
  1299.      are from the quick start initialization file provided on the distribu-
  1300.      tion diskette, and use "pkzip".
  1301.  
  1302.          Dump = pkzip a:\fsave%number% -ex -P -r- -whs -& -a+ @%list%
  1303.          IncrementalDump = pkzip a:\fsave%number% -ex -P -r- -whs -& @%list%
  1304.  
  1305.      These both create  compressed  archives  on  the  "a:"  diskette;  the
  1306.      archive files are named "fsave1.zip", "fsave2.zip", and so forth; max-
  1307.      imum compression is used; the complete pathname for each saved file is
  1308.      kept; subdirectories are not recursively processed (because FSave does
  1309.      that); "hidden" and "system" files (if selected  by  FSave)  are  also
  1310.      saved; the zip files may span multiple diskettes; and the names of the
  1311.      files to save are taken from "fsave1.txt", "fsave2.txt" and  so  forth
  1312.      in  the temporary directory.  The only difference between the two com-
  1313.      mands is that the archive bits of the saved files are not  turned  off
  1314.      after  an  incremental  dump.   This  is  a  personal preference whose
  1315.  
  1316.  
  1317. 1.5                               - 17 -                            7/29/94
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.                                    FSave
  1326.  
  1327.  
  1328.      ramifications are discussed more fully in a later chapter.
  1329.  
  1330. FileSize = nnn
  1331.      If given, this entry limits the size of the files containing the  list
  1332.      of  names  to  back  up to the number of bytes specified.  Once a list
  1333.      file goes over this size, a new one is started. For  example,  "pkzip"
  1334.      cannot process list files that are larger than a certain maximum size.
  1335.      "nnn" represents an integer byte size.  If omitted, the list  file  is
  1336.      not limited in size. Example:
  1337.  
  1338.          FileSize = 5000
  1339.  
  1340.  
  1341. ReportDeleted = value ($$$)
  1342. ReportUnsaved = value ($$$)
  1343.      These entries specify how you want FSave to  report  files  that  have
  1344.      been  deleted,  and  files  that  were not saved though they have been
  1345.      modified.  "value" may be any of the following:
  1346.  
  1347.                     none     No reporting is done.
  1348.                     file     Report to a file (default).
  1349.                     screen   Report to the screen.
  1350.                     both     Report to a file and the screen
  1351.  
  1352.      Report files are written in the temporary  directory,  and  are  named
  1353.      "deleted.txt"  and "unsaved.txt" respectively.  When not in test mode,
  1354.      the report of deleted files is usually of academic interest (how  much
  1355.      disk  space  did  it reclaim?), but the report of modified-but-unsaved
  1356.      files can point out files that ought to be saved but  are  not.   This
  1357.      file should be examined often to see whether the addition of new files
  1358.      has required a change in a configuration.
  1359.  
  1360.      ($$$) The shareware  version  does  not  delete  files,  so  none  are
  1361.      reported.   Reporting  of  unsaved files is limited only to the "file"
  1362.      type.
  1363.  
  1364. SaveHidden = value ($$$)
  1365.      This entry specifies  whether  hidden,  system,  and  read-only  files
  1366.      should be examined by FSave.  "value" may be either "yes" or "no"; the
  1367.      default value is "no", meaning that these files  are  always  skipped.
  1368.      If  "yes"  is  specified,  then these files will be saved if they meet
  1369.      whatever other criteria are given in the current configuration.
  1370.  
  1371. SaveList = (directory)
  1372.      If given, this entry specifies a directory to  which  the  list  files
  1373.      should  be  copied  before the archiving takes place.  This provides a
  1374.      convenient way to copy the list files to  the  archive  media  itself,
  1375.      where  they  can  be  used  as a table of contents later if individual
  1376.      files must be retrieved.  "(directory)" is an absolute pathname.   The
  1377.      example  below  is used with the dump commands above, that write their
  1378.      output to "a:".
  1379.  
  1380.  
  1381.  
  1382.  
  1383. 1.5                               - 18 -                            7/29/94
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.                                    FSave
  1392.  
  1393.  
  1394.          SaveList = a:\
  1395.  
  1396.  
  1397. SwitchChar = value ($$$)
  1398.      This determines which character is used on the command line  to  indi-
  1399.      cate  options.   The  value  may be either "/" or "-", and defaults to
  1400.      "/".
  1401.  
  1402. Temp = (directory)
  1403.      Specifies a temporary directory in which the list and report files are
  1404.      written.  This should probably not be a directory that you are backing
  1405.      up.  "(directory)" is an absolute  pathname.   If  the  entry  is  not
  1406.      given, "c:\tmp" will be used.  Example:
  1407.  
  1408.          Temp = d:\temp
  1409.  
  1410.  
  1411. 6.7.  Command Line Arguments
  1412.  
  1413.      There are many command line arguments that can be given to modify  how
  1414. FSave  does  it  work.  Any number of these may be used on the command line
  1415. when FSave is invoked.
  1416.  
  1417.      Options  are  introduced  with  either  the  "/"   character,   unless
  1418. "fsave.ini"  specifies  that  "-"  be used instead.  The options are listed
  1419. alphabetically below.
  1420.  
  1421. /a ($$$)
  1422.      Starting at the current directory, find all files whose archive bit is
  1423.      set and record their names and sizes in the "unsaved.txt" file.
  1424.  
  1425. /c   Causes the configuration to be printed on the  screen  for  each  sub-
  1426.      directory  processed.   This is useful in debugging your configuration
  1427.      files, although it does generate much output when FSave looks  at  the
  1428.      whole disk.
  1429.  
  1430. /d ($$$)
  1431.      This is "delete mode" - FSave scans the directories it normally would,
  1432.      but  all  it  does  is to delete the files specified in the configura-
  1433.      tions.  This is a convenient way of cleaning the litter off your  disk
  1434.      when space starts getting tight.
  1435.  
  1436. /D mm/dd/yyyy
  1437. /D mm/dd/yy
  1438.      Overrides the date set in the configuration files with the given date.
  1439.      This  may be used to create a master backup of a specific directory to
  1440.      reduce the amount of data that must be saved in an ordinary filesave.
  1441.  
  1442. /f name ($$$)
  1443.      The default base name for the list files is  "fsave",  unless  a  dif-
  1444.      ferent  value  was specified in the initialization file with the "Con-
  1445.      figName" ($$$) entry.  This option overrides that and  allows  a  dif-
  1446.      ferent  base  name  to  be  specified.   The base name should be short
  1447.  
  1448.  
  1449. 1.5                               - 19 -                            7/29/94
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.                                    FSave
  1458.  
  1459.  
  1460.      enough to allow the list file number to be appended to it.  For  exam-
  1461.      ple,  if  your  backup requires fifteen list files, the maximum length
  1462.      allowed for the base name would be six characters.  This is useful  to
  1463.      store many small backups on the same diskette.
  1464.  
  1465. /i   This does an "incremental" backup.  Files are  selected  according  to
  1466.      the configuration as usual, except only those whose archive bit is set
  1467.      are added to the list of files to be saved.  The default is to back up
  1468.      all  files that match the configuration criteria, whether or not their
  1469.      archive bit is set.  Full and incremental backups are  discussed  more
  1470.      fully in a later chapter.
  1471.  
  1472. /n name ($$$)
  1473. /N name ($$$)
  1474.      These options specify the name of the configuration file to  use  when
  1475.      an  alternate configuration is desired.  The suffix ".cnf" is appended
  1476.      to the given name.  If "/n" is used, only configuration files with the
  1477.      specified  name will be read.  If "/N" is used, FSave attempts to read
  1478.      a configuration file with the specified name; if none  is  found,  the
  1479.      default configuration file is read instead.
  1480.  
  1481. /o number ($$$)
  1482.      This option overrides various aspects of the configuration files.  The
  1483.      following numbers are implemented:
  1484.  
  1485.  
  1486.            1   Save files even if their modification dates are earlier than
  1487.                the configuration.
  1488.            2   Save files even if their names match a pattern in the "Skip-
  1489.                Files" list.
  1490.            4   Save files even if their names match a pattern in the "Skip-
  1491.                Files"  list,  OR if their names do not match any pattern in
  1492.                the "SaveFiles" list.
  1493.            8   Recursively process subdirectories even if their  names  ap-
  1494.                pear in the "SkipDirs" list.
  1495.           16   Recursively process subdirectories even if their  names  ap-
  1496.                pear  in  the "SkipDirs" list OR if their names do not match
  1497.                any pattern in the "SaveDirs" list.
  1498.           32   Do not delete files specified in the "DeleteFiles" list.
  1499.           64   Do not create a "saved.txt" or the "fsave1.txt" files.  This
  1500.                means that nothing will be backed up.
  1501.          128   Do not create an "unsaved.txt" file, despite what  the  ini-
  1502.                tialization file indicates.
  1503.          256   Do not create a "deleted.txt" file, despite  what  the  ini-
  1504.                tialization file indicates.
  1505.          512   Invert the meaning of the configuration date, that is,  save
  1506.                only  files  whose  dates are earlier than the configuration
  1507.                date.
  1508.         1024   Ignore the "IgnoreUnsaved" list; report all unsaved modified
  1509.                files in the "unsaved.txt" file.
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515. 1.5                               - 20 -                            7/29/94
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.                                    FSave
  1524.  
  1525.  
  1526.      More than one of these overrides may  be  specified  by  adding  their
  1527.      numbers together.  For example,
  1528.  
  1529.          /o 7
  1530.  
  1531.      specifies the first three overrides.  Alternatively, you may give mul-
  1532.      tiple "/o" options on the command line:
  1533.  
  1534.          /o 1 /o 2 /o 4
  1535.  
  1536.      also specifies the first three overrides.
  1537.  
  1538. /t   This is the "testing" mode.  FSave creates the list  of  files  to  be
  1539.      saved  in  a file "saved.txt" in the temporary directory, but does not
  1540.      invoke the archiving program to save them.  In addition, the size  and
  1541.      modification  date of each file are also written to the file, allowing
  1542.      you to discover files that should not be saved so that you can  modify
  1543.      the configuration accordingly.  Unsaved files are reported normally as
  1544.      well.
  1545.  
  1546. 6.8.  Starting FSave
  1547.  
  1548.      By default, FSave begins its work in the directory from  which  it  is
  1549. started;  pathnames  for  saved  files  are given relative to this starting
  1550. directory.  The normal way of running FSave is from the root  directory  of
  1551. your hard disk, like this:
  1552.  
  1553.     cd c:\
  1554.     fsave
  1555.  
  1556.  
  1557.      You may also start FSave from a subdirectory, like this:
  1558.  
  1559.     cd c:\quickenw
  1560.     fsave
  1561.  
  1562. The directory from which FSave is started will be treated as if it were the
  1563. "root"  directory;  specifically,  pathnames  for saved files will be given
  1564. relative to it, and the configuration files in parent directories will  not
  1565. be  processed.   Sometimes  this is useful, for example, to create a master
  1566. backup of a specific directory without regard to the dates of its files.
  1567.  
  1568.      The third way of starting FSave is from the root directory,  but  with
  1569. pathnames  to  one or more specific subdirectories given as arguments after
  1570. the options, like this:
  1571.  
  1572.     cd c:\
  1573.     fsave quickenw
  1574.  
  1575. For each pathname given, FSave starts with its default configuration, reads
  1576. the  configuration files in each subdirectory on the way down to the speci-
  1577. fied one, and then begins operating in that directory.  Pathnames of  saved
  1578. files  will  be  given  relative  to  the target directory.  The difference
  1579.  
  1580.  
  1581. 1.5                               - 21 -                            7/29/94
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.                                    FSave
  1590.  
  1591.  
  1592. between this method and the second method above is that  the  configuration
  1593. information developed from the root down to that directory is processed.
  1594.  
  1595. 6.9.  Starting FSave from Windows
  1596.  
  1597.      Once you have finalized your  personal  filesave  procedure,  you  can
  1598. avoid  the  need  to open a DOS window by starting FSave directly from Win-
  1599. dows.  This is easily done with these steps.
  1600.  
  1601. (1)  Copy the batch file "wfsave.bat" and the icon "fsave.ico" to the  same
  1602.      directory in which you put "fsave.exe".  The batch file contains these
  1603.      commands:
  1604.  
  1605.          @echo off
  1606.          rem Batch file to run fsave.exe from Windows
  1607.          fsave %1 %2 %3 %4 %5 %6 %7 %8 %9
  1608.          pause
  1609.  
  1610.  
  1611. (2)  Now go to the Program Manager and select "File|New", then select "Pro-
  1612.      gram  Item"  and  click  "OK".   Enter "Filesave" for the description,
  1613.      "wfsave.bat" for the command line, and "\." for the working directory.
  1614.      You may use the icon in "fsave.ico" if you wish.  Then click on "OK".
  1615.  
  1616. (3)  To do a  filesave,  simply  double-click  this  item  in  the  Program
  1617.      Manager.   If  Windows  complains that it cannot find "wfsave.bat" you
  1618.      will need to use "File|Properties" and  change  the  command  line  to
  1619.      include the complete pathname to it.
  1620.  
  1621.      The "pause" command in the batch file allows you to read  the  results
  1622. of  FSave  before the DOS screen disappears.  The batch file can be invoked
  1623. with different arguments; for instance you can create another program  item
  1624. whose command line is
  1625.  
  1626.     wfsave.bat /t
  1627.  
  1628. to do a test save, and a third whose command line is
  1629.  
  1630.     wfsave.bat /a
  1631.  
  1632. ($$$) to look for modified but unsaved files.
  1633.  
  1634. 7.  Strategies for Using Configurations
  1635.  
  1636.      With its default configuration, FSave  will  save  everything  on  the
  1637. disk.   The  name  of the game is to create configurations that prevent any
  1638. files from being saved that could be recovered from other media.
  1639.  
  1640. 7.1.  The Root Directory
  1641.  
  1642.      The quick start chapter illustrated the most basic strategy: the  con-
  1643. figuration  file  in  the  root directory specifies an overall date for the
  1644. system.  On many PCs, using the date that the machine was  purchased  is  a
  1645.  
  1646.  
  1647. 1.5                               - 22 -                            7/29/94
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.                                    FSave
  1656.  
  1657.  
  1658. good  start,  as the software that came with the machine is obviously older
  1659. than that.
  1660.  
  1661.      Of course this implies that you still have the  diskettes  from  which
  1662. that  software  was  loaded.   If  you do not, or if your machine came with
  1663. preloaded software and you have no backup media, you will have to create  a
  1664. master  backup.   This  process  is  described  in  more  detail in a later
  1665. chapter.
  1666.  
  1667.      In addition, the configuration file in the root directory can  mention
  1668. any specific files or directories that need not be saved.  For example, the
  1669. configuration file in the root directory on my hard disk looks like this:
  1670.  
  1671.     DateAll = 3/1/93
  1672.     SkipDirs = tmp video
  1673.  
  1674. This indicates that no files dated earlier than  3/1/93  should  be  saved;
  1675. "DateAll" was specified so this date applies in this directory and all sub-
  1676. directories (until overridden by another configuration file in a  subdirec-
  1677. tory  somewhere).   I  also  have  specified that the directories "tmp" and
  1678. "video" are to be skipped; this is because "tmp" is a  temporary  directory
  1679. that  contains  only  scratch  files,  and nothing in "video" ever changes.
  1680. Note that these names were specified in the local  configuration  only,  so
  1681. they  apply  only  to this directory.  Once FSave enters a subdirectory the
  1682. specification to skip "tmp" and "video" is discarded.  On the  other  hand,
  1683. the  keyword  "DateAll"  put the date in the global configuration, so it is
  1684. carried into all subdirectories until  modified  by  another  configuration
  1685. file.
  1686.  
  1687. 7.2.  Subdirectories
  1688.  
  1689.      The type of configuration needed in a subdirectory  depends  upon  how
  1690. the  files  that it contains are used.  Several possibilities are discussed
  1691. below; there are probably additional cases  that  I've  missed,  but  these
  1692. examples  should  be  enough  to give you ideas for handling other types of
  1693. directories.
  1694.  
  1695. 7.2.1.  Static Directories
  1696.  
  1697.      Some directories contain files  that  simply  never  change,  or  that
  1698. change  only trivially.  Here, "trivially" means that the changes are unim-
  1699. portant; if the file were lost, a restored copy of the file in its original
  1700. form would be perfectly acceptable.
  1701.  
  1702.      Directories such as these  can  simply  be  skipped.   Be  very  sure,
  1703. though,  that  any  modifications  that  subsequently occur to files in the
  1704. directory are indeed trivial as described above.
  1705.  
  1706.      You might ask, "What harm is  there  in  FSave  looking  through  this
  1707. directory  -  if  nothing is saved, it costs little to look." This is true,
  1708. and it is easy to argue that this approach is safer as well; should a  file
  1709. in this directory change unexpectedly, then it will be saved.
  1710.  
  1711.  
  1712.  
  1713. 1.5                               - 23 -                            7/29/94
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.                                    FSave
  1722.  
  1723.  
  1724.      It does take a small amount of time for FSave to process a  directory.
  1725. A  bigger  cost,  though, is that the directory index (described fully in a
  1726. later chapter) that must be created, backed up, and then  deleted.   For  a
  1727. directory  that truly has no activity, this effort is wasted.  FSave allows
  1728. you to specify whichever option you think is best.
  1729.  
  1730. 7.2.2.  Dynamic Directories
  1731.  
  1732.      If a directory contains files that are all constantly  changing,  then
  1733. everything  in  the directory should be saved.  This is easily accomplished
  1734. by setting the configuration date to 1/1/80 (or any date earlier  than  the
  1735. oldest file you wish to save).
  1736.  
  1737. 7.2.3.  Static/Dynamic Directories
  1738.  
  1739.      These previous two cases are easy to handle; these dirctories are more
  1740. interesting.
  1741.  
  1742.      Some directories contain files that are constantly being modified  and
  1743. files  that  never  change.   A  directory that contains a software package
  1744. probably contains files that are unchanged since the installation and files
  1745. that  are  modified  every  time  the package is used.  The straightforward
  1746. approach to configuring these directories is to  specify  a  date  that  is
  1747. later than any of the unchanged files but before all of the modified files.
  1748. In principle, there may be overlap between  these  date  ranges,  but  this
  1749. rarely occurs in practice.
  1750.  
  1751.      The obvious choice for this date is the day after  you  installed  the
  1752. software:  anything you have changed since the installation cannot be dated
  1753. before the installation.  If portions of the software  or  its  data  files
  1754. reside  in  subdirectories, setting the global date in the configuration of
  1755. the main directory causes it to be used in each subdirectory as well.   For
  1756. many directories, this is all that will be needed.
  1757.  
  1758.      Things become more interesting when updates are applied  to  the  pro-
  1759. grams in such a directory.  After being patched, the modified programs will
  1760. have dates that are more recent than many data files that are being  saved.
  1761. The question is, do you want to save the modified program?
  1762.  
  1763.      It depends.  Suppose you don't want save the  program.   This  can  be
  1764. accomplished  by  changing  its  date  with  the  "setftime"  ($$$) utility
  1765. included with FSave, or by changing the date  in  the  configuration  file.
  1766. Should  you  need  to  reload it later, though, the program will have to be
  1767. patched again so you must save the patch information and take the  time  to
  1768. apply the patch again after reloading.  However, the filesave remains small
  1769. and fast because this program does not get saved each time you back up your
  1770. system.
  1771.  
  1772.      On the other hand, suppose you do  want  to  save  the  program.   The
  1773. filesave gets larger and slower, but it is easier to restore the program if
  1774. you need it because the patched version was being  saved  all  along.   The
  1775. problem  is  that  the filesave, which occurs frequently (we hope), becomes
  1776. less convenient to make restoring the file, which occurs  infrequently  (we
  1777.  
  1778.  
  1779. 1.5                               - 24 -                            7/29/94
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.                                    FSave
  1788.  
  1789.  
  1790. hope!) more convenient: this is backwards.
  1791.  
  1792.      There is a simple compromise between these extremes.  First,  set  the
  1793. date  in  the  configuration file as you normally would to ensure that your
  1794. modified files are saved.  Then, when the amount of data being  saved  from
  1795. the  directory  grows enough to justify the effort, make a master backup of
  1796. everything in the directory.  Then change the  date  in  the  configuration
  1797. file to be the day after you created the master backup.
  1798.  
  1799.      By taking the time to back up the entire directory once, your periodic
  1800. filesaves  become  quicker  and easier because only the files changed since
  1801. you created your master backup will be saved.  Later,  when  an  inordinate
  1802. amount  of  data  is  again  being  saved from this directory, a new master
  1803. backup can be created and the process starts anew.
  1804.  
  1805. 7.2.4.  The \windows Directory
  1806.  
  1807.      The "\windows" directory is an example of a static/dynamic  directory:
  1808. it contains program manager group files that change almost constantly; ini-
  1809. tialization files that change, some frequently and  some  less  frequently;
  1810. and  executables  and  other  files  that  change rarely, if at all.  It is
  1811. tempting to classify changes to the program manager files  and  initializa-
  1812. tion  files as trivial and skip this directory, but I prefer to back it up:
  1813. the amount of data is small enough that it is not a  bother,  and  I  won't
  1814. have to go through each of my applications after reloading and get them all
  1815. set up again.
  1816.  
  1817. 7.2.5.  The \windows\system Directory
  1818.  
  1819.      Interestingly, the "\windows\system" directory is a  different  story.
  1820. The  files  it  contains (device drivers and dynamic link libraries) do not
  1821. change, while new files may be added to the  directory  every  time  a  new
  1822. package  is  installed.   The  difficulty  here is that the newly installed
  1823. files may be dated months or years in the past, making it impossible to use
  1824. dates  to  discriminate  between "old, unmodified" files and "new, changed"
  1825. files.
  1826.  
  1827.      One approach to this dilemma is  to  skip  the  directory  completely.
  1828. After all, it can be reconstructed by reloading the original operating sys-
  1829. tem and then reloading each application one by one.   On  the  other  hand,
  1830. suppose  you accidentally deleted just this one directory.  You would prob-
  1831. ably not be thrilled by the prospect of reloading all of your software (and
  1832. possibly   reapplying   patches)  just  to  recover  the  contents  of  the
  1833. "\windows\system" directory.
  1834.  
  1835.      A more conservative strategy is to create  a  master  backup  of  this
  1836. directory (which is unpleasant due to its size), and clear the archive bits
  1837. of all files in the directory.  Then periodically examine it  to  see  what
  1838. files  have  been  added  or  changed.  Imagine having to reload all of the
  1839. software packages (and reapply whatever patches are appropriate)  to  which
  1840. these files belong: when this prospect begins to make you shudder, create a
  1841. new master backup.  Again, you cannot rely upon modification dates for this
  1842. directory   because   files  added  to  the  directory  during  a  software
  1843.  
  1844.  
  1845. 1.5                               - 25 -                            7/29/94
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.                                    FSave
  1854.  
  1855.  
  1856. installation might have any modification date.
  1857.  
  1858. 7.3.  Testing Configurations
  1859.  
  1860.      The test mode of FSave provides a  quick  and  easy  way  to  see  the
  1861. results  of new or modified configurations.  Simply examine the "saved.txt"
  1862. and "unsaved.txt" files to see which files are saved and the modified files
  1863. that are not saved.
  1864.  
  1865.      If you think that FSave is not saving the  files  you  specified,  try
  1866. checking  your  configuration with the "/c" option.  This causes the confi-
  1867. guration to be printed for each directory FSave processes; by examining the
  1868. progression  of  configurations from the root directory to the one in which
  1869. the problem is occurring, you can locate the erroneous configuration file.
  1870.  
  1871. 8.  Master Backups
  1872.  
  1873. 8.1.  What Is a Master Backup?
  1874.  
  1875.      What is a "master backup", how do you create one, and  why  would  you
  1876. want  to  create one?  Simply stated, a master backup is a backup of all of
  1877. the files in a particular directory.  The interesting part of this  is  the
  1878. word "all", as you shall soon see.
  1879.  
  1880.      Why would you want such a thing?  A  master  backup  can  serve  as  a
  1881. replacement  for  the  installation  medium  for  software  whose  original
  1882. diskettes have been lost, damaged or discarded.  Additionally,  creating  a
  1883. master  backup  reduces  the  amount  of  data  that  must be saved in your
  1884. periodic filesaves.  After creating the master backup, the date in the con-
  1885. figuration  for  the  directory  can be changed to the day after the master
  1886. backup; only files modified after the master backup  need  be  periodically
  1887. saved.
  1888.  
  1889. 8.2.  Creating a Master Backup
  1890.  
  1891.      A master backup can be created in either of two ways.  The easiest way
  1892. is  to  simply use "pkzip" (or your favorite compressing/archiving program)
  1893. in its usual way to save everything in the directory.  This  is  easy,  but
  1894. has  the disadvantage of including all files in the backup.  Now I can hear
  1895. you saying, "but the whole point was to get all the files!"  True,  but  if
  1896. the  directory  contains  large data files that are frequently modified and
  1897. thus will be saved in your ordinary filesaves, you may find  it  more  con-
  1898. venient to omit them from the master backup to reduce its size.
  1899.  
  1900.      A slightly more involved method way is to  create  the  master  backup
  1901. using FSave.  Special options are used to override the configuration in the
  1902. directory.  For example:
  1903.  
  1904.     cd c:\quickenw
  1905.     fsave /D 1/1/80
  1906.  
  1907. will save files in the "quickenw" directory regardless  of  date.   If  the
  1908. configuration  in this directory specifies files to skip, you may prefer to
  1909.  
  1910.  
  1911. 1.5                               - 26 -                            7/29/94
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.                                    FSave
  1920.  
  1921.  
  1922. use
  1923.  
  1924.     cd c:\quickenw
  1925.     fsave /D 1/1/80 /o 4
  1926.  
  1927. which will save files even if they appear in the  "Skip"  list  or  do  not
  1928. appear in the "Save" list.
  1929.  
  1930.      If the directory contains subdirectories that should be on the  master
  1931. backup  but  are skipped by the configuration, the following commands would
  1932. be used:
  1933.  
  1934.     cd c:\quickenw
  1935.     fsave /D 1/1/80 /o 16
  1936.  
  1937.  
  1938.      Another alternative is to set the date in the  configuration  file  to
  1939. today's date, and then use this command:
  1940.  
  1941.     fsave /o 4 /o 16 /o 512
  1942.  
  1943. Besides saving files and directories regardless of the  "Save"  and  "Skip"
  1944. lists, this command inverts the meaning of the configuration date, so FSave
  1945. backs up only those files whose date is  earlier  than  the  configuration.
  1946. Now  an  ordinary filesave will back up all the remaining files, so between
  1947. the master backup and an ordinary backup every file has been saved.
  1948.  
  1949.      Here is another technique that can be  useful.   Create  an  alternate
  1950. configuration  file  (see  chapter  11)  containing the date that separates
  1951. files unchanged since they were installed from the  files  that  have  been
  1952. modified,  and  use this to create the master backup.  Then set the date in
  1953. the regular configuration file to the  day  after  the  master  backup  was
  1954. created.   Your  regular  filesaves  will  back up only those files changed
  1955. since the master backup was taken, but the master  backup  itself  will  be
  1956. shorter  because  it will not include any files which can be recovered from
  1957. the original distribution media.
  1958.  
  1959. 8.3.  Whole System Master Backup
  1960.  
  1961.      This final technique will appeal to those who are nervous about  being
  1962. able  to  restore  everything  properly  from  distribution disks and other
  1963. sources.  First, make a master backup of your entire disk.  You can do this
  1964. with  FSave  using  any of the methods described above, or you can just use
  1965. "pkzip" or your favorite archiving  program  in  the  usual  manner.   (You
  1966. should  get  a  _l_a_r_g_e stack of floppy disks ready, however.) Then, create a
  1967. configuration file in the root directory of the disk and specify  "DateAll"
  1968. to be the day after you created the master backup.
  1969.  
  1970.      That's all there is to it.  You don't even need to  create  any  other
  1971. configuration  files  unless certain directories need not be saved, or con-
  1972. tain files that need not be saved.  When your backups become  large  enough
  1973. to  be  a  nuisance,  make  a  new master backup of the whole disk and then
  1974. modify the "DateAll" appropriately.
  1975.  
  1976.  
  1977. 1.5                               - 27 -                            7/29/94
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.                                    FSave
  1986.  
  1987.  
  1988. 9.  Restoring Files from Backups
  1989.  
  1990.      Restoring files after a hard disk failure is straightforward, if tedi-
  1991. ous:  reload  the operating system, reload all software packages from their
  1992. installation media or your master backups, then reload the latest backup.
  1993.  
  1994.      It is impossible to give specific instructions on how to  "reload  the
  1995. latest  backup",  as  the exact procedure depends on what archiving program
  1996. you used to create the backup.  However, here are some general hints.
  1997.  
  1998. (1)  FSave stores the pathname for each saved file relative to  the  direc-
  1999.      tory  you  were in when you made the backup.  In order to restore your
  2000.      files to their proper locations, change to that same directory  before
  2001.      beginning to restore files.
  2002.  
  2003. (2)  Use whatever program is appropriate to extract files, for example,  if
  2004.      you  used  "pkzip"  to create the archive, then use pkunzip to extract
  2005.      files from it.  Run this program on each archive  file,  one  by  one,
  2006.      until you have restored them all.
  2007.  
  2008. (3)  If the extraction program has an option that preserves  the  directory
  2009.      structure  of  the  restored  files, use it.  If this is not done, all
  2010.      your files will end up in the root directory.
  2011.  
  2012. (4)  It is irritating to restore files from a backup that takes  more  than
  2013.      one  diskette  when  you  are  using  a  program such as pkunzip which
  2014.      requires you to begin by inserting the last disk of an archive.   This
  2015.      is  because you need to know whether each archive file is split across
  2016.      two or more diskettes, and if so, which diskettes it resides on.  This
  2017.      is  most  easily  handled  by  printing  the directory listing of each
  2018.      diskette before beginning to restore your files; when you are asked to
  2019.      insert  the last diskette for an archive, simply consult the directory
  2020.      listings beginning with the one for the current diskette to  find  the
  2021.      one  that  contains  the  last part of the archive.  For archive files
  2022.      which are contained entirely on the current diskette, there is no need
  2023.      to insert any other one.
  2024.  
  2025.      If you are lucky enough to have the space to be able  to  create  your
  2026. backup  files right on the hard disk, restoring files is much easier.  This
  2027. is because the entire archive file is on the disk, so there is no  need  to
  2028. be swapping diskettes in and out.
  2029.  
  2030. 9.1.  Re-Deleting Deleted Files
  2031.  
  2032.      This is tedious, but not difficult.   But  there  is  a  complication.
  2033. Suppose  you  bought a brand new application, loaded it on your system, and
  2034. then decided to delete the several files containing tutorials and examples.
  2035. After  backing up this directory several times, the disk fails.  Now you've
  2036. gotten your disk repaired and want to reload it, so you  follow  the  steps
  2037. listed  above.  When you are finished, you will find that the tutorials and
  2038. examples have reappeared.  This problem is solved with the directory index.
  2039.  
  2040.  
  2041.  
  2042.  
  2043. 1.5                               - 28 -                            7/29/94
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.                                    FSave
  2052.  
  2053.  
  2054. 9.2.  Directory Index
  2055.  
  2056.      A "directory index" ($$$) is just a list of all the files in a  direc-
  2057. tory, whether they are saved or not; it is written to the file "fsave.idx",
  2058. and  saved  in  the  backup.   After  restoring  a  directory  from  backup
  2059. diskettes,  it  may contain files had been deleted.  The "reconcil" program
  2060. ($$$) provided with FSave can then be run to reconcile the  directory  con-
  2061. tents with the index.  This program deletes files that should not be there,
  2062. and reports differences between the actual directory contents and the  con-
  2063. tents  as  specified  in the index file.  When this is completed, the index
  2064. file itself is deleted.
  2065.  
  2066.      Directory index files are not created by default because of the  addi-
  2067. tional  time and space that they require.  The "DirectoryIndex" ($$$) entry
  2068. in the initialization file is used to enable directory indices.
  2069.  
  2070. 9.3.  Restoring Individual Files
  2071.  
  2072.      Restoring a specific file from a backup is takes two easy steps.
  2073.  
  2074. (1)  Determine which archive the file is in.  This can be done by using  an
  2075.      editor  to  examine  the  list  files  which  are written to the first
  2076.      diskette.  Or, you can use your archive extracting program to print  a
  2077.      list of what is in each archive file.
  2078.  
  2079. (2)  When you know which archive the desired file is in, use  your  archive
  2080.      extracting program to extract it.
  2081.  
  2082.      If you wish to put the file to where it originally resided, change  to
  2083. the directory you were in when you created the backup before restoring, and
  2084. if your extracting program has an option to preserve the  directory  struc-
  2085. ture  of  the  restored  file, use it.  If you want the file to be restored
  2086. somewhere else, either do the restore from a different  directory,  do  not
  2087. use the option to preserve the directory structure, or both.
  2088.  
  2089. 10.  Incremental Backups
  2090.  
  2091.      When even FSave backups begin to get cumbersome, consider doing incre-
  2092. mental  backups  interspersed with an occasional full backup.  In an incre-
  2093. mental backup, files are selected for backup in the usual manner, and  then
  2094. one additional constraint is imposed: the archive bit must be set.
  2095.  
  2096.      For this to work, the archiving command used  for  full  backups  must
  2097. clear  the  archive  bits of the files saved.  Then, as files are modified,
  2098. their archive bits are set; the next  incremental  backup  will  save  only
  2099. those files that have been modified since the last full backup.
  2100.  
  2101. 10.1.  Incremental and Delta Backups
  2102.  
  2103.      An incremental backup saves everything modified since  the  last  full
  2104. backup  was  taken.  To do this, the archiving command used for incremental
  2105. backups must not clear the archive bits of files saved.  Thus, each  incre-
  2106. mental  backup contains all of the files on the preceding one, and possibly
  2107.  
  2108.  
  2109. 1.5                               - 29 -                            7/29/94
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.                                    FSave
  2118.  
  2119.  
  2120. some new ones.
  2121.  
  2122.      Incremental backups get larger and larger,  then,  as  time  goes  by.
  2123. When  they get uncomfortably large, a full backup is done.  The next incre-
  2124. mental backup will be small again.
  2125.  
  2126.      An alternative strategy is what I call "delta" backups.  This  is  the
  2127. same  as  an  incremental  backup except for one thing: the archive bits of
  2128. files saved in a delta backup are cleared after the  backup  is  completed.
  2129. This  means that each delta backup saves only those files that were changed
  2130. since the last delta backup, so they do not continue  to  grow  larger  and
  2131. larger.
  2132.  
  2133.      On the other hand, no single delta backup contains all  of  the  files
  2134. that  have  changed  since the last full backup.  This makes restoring from
  2135. delta backups more tedious, as described below.
  2136.  
  2137.      FSave allows you to choose either incremental or delta backups.   This
  2138. is  specified indirectly in the command you provide to do incremental back-
  2139. ups: if the command causes the archive bits to be cleared,  you  get  delta
  2140. backups.  If the command does not clear the archive bits, you get incremen-
  2141. tal backups.  Be aware, however: this is just another tradeoff.  The  price
  2142. paid  for the benefit of the smaller and faster incremental backups is that
  2143. restoring your disk will take more time.
  2144.  
  2145. 10.2.  Restoring from Incremental Backups
  2146.  
  2147.      To restore from incremental backups, you begin by doing all  the  same
  2148. steps  described earlier, but then the latest incremental backup (or all of
  2149. the delta backups, in order) must also be reloaded.  Even restoring a  sin-
  2150. gle  file  is more complex: to get the latest version of a file, the latest
  2151. incremental backup must be checked to see if it contains the file; if  not,
  2152. the  latest  full backup is used.  Delta backups are even worse: all of the
  2153. delta backups done after the most recent full backup must  be  examined  in
  2154. reverse order; the first one that contains the desired file is used.
  2155.  
  2156.      If this sounds bad, remember that we hope to be restoring  files  much
  2157. less  often  than we back them up.  If restores are needed frequently, your
  2158. configuration files should probably specify backing up more files, and  you
  2159. should avoid incremental or delta backups to simplify restorations.
  2160.  
  2161. 11.  Alternate Configurations
  2162.  
  2163.      FSave allows several different sets of configurations to exist on  the
  2164. same disk.  This is done by storing the configurations with different names
  2165. and using command line options to select from among them.
  2166.  
  2167. 11.1.  Specifying an Alternate Configuration
  2168.  
  2169.      The default configuration is always stored in files named  "fsave.cnf"
  2170. in various directories on the disk.  With the "/n" option, a different name
  2171. can be specified.  For example, the command:
  2172.  
  2173.  
  2174.  
  2175. 1.5                               - 30 -                            7/29/94
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.                                    FSave
  2184.  
  2185.  
  2186.     fsave /n fsaveall ($$$)
  2187.  
  2188. would do the usual filesave activity,  but  would  look  for  configuration
  2189. information in files named "fsaveall.cnf".
  2190.  
  2191.      The "/N" ($$$) option works in much the same way,  except  that  if  a
  2192. directory  does  not  contain a configuration with the specified name, then
  2193. FSave tries to read the default configuration file instead.
  2194.  
  2195. 11.2.  Using Alternate Configurations
  2196.  
  2197.      Multiple configurations may be used in many ways.  First, they provide
  2198. a  simple  way to create master backups of specified directories: while the
  2199. ordinary configuration specifies a date and directories to skip, an  alter-
  2200. nate configuration might specify none of these, thus saving the entire disk
  2201. or directory.
  2202.  
  2203.      Second, they can be used to set up  a  multilevel  incremental  backup
  2204. scheme,  in  which  different configurations specify different dates and/or
  2205. file/directory combinations.
  2206.  
  2207.      One final example uses different configurations to back  up  different
  2208. subsets  of  the disk.  For example, you might wish to save the contents of
  2209. one set of directories on 1.44 Mb floppy disks, but save a different set of
  2210. directories on 1.2 Mb floppies.  Or perhaps each different user of a system
  2211. might wish to use their own configurations to back up their own  subset  of
  2212. the data on the system.
  2213.  
  2214. 12.  Unix-Style Filename Patterns
  2215.  
  2216. 12.1.  Overview
  2217.  
  2218.      Filename patterns on Unix systems are for the most part a superset  of
  2219. MS-DOS filename patterns.  Unix-style patterns may contain ordinary charac-
  2220. ters and wildcard characters.
  2221.  
  2222.      Ordinary characters appearing in a pattern must match the next charac-
  2223. ter  in  the  filename.   On  Unix  systems,  case  is  significant; MS-DOS
  2224. filenames are all monocase, so FSave translates all filenames and  filename
  2225. patterns  to  upper  case when they are read.  Note that the period is con-
  2226. sidered to be an ordinary character.
  2227.  
  2228.      The first wildcard character is the asterisk, which  matches  zero  or
  2229. more of any characters, including the period.
  2230.  
  2231.      The second wildcard character is  the  question  mark,  which  matches
  2232. exactly  one  character.   This is different from the MS-DOS interpretation
  2233. which, in some circumstances, allows the question mark to match either zero
  2234. or one character.
  2235.  
  2236.      Finally, the square brackets enclose a character class:  this  matches
  2237. any  one  of  the characters contained in the class.  Character classes may
  2238. contain character ranges such as "a-z" and "0-9;"  this  is  equivalent  to
  2239.  
  2240.  
  2241. 1.5                               - 31 -                            7/29/94
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.                                    FSave
  2250.  
  2251.  
  2252. specifying  each  of  the  individual characters in the range.  A character
  2253. class that begins with a caret (^) is interpreted as containing only  those
  2254. characters that are not contained in the brackets.
  2255.  
  2256. 12.2.  Examples
  2257.  
  2258.      Several examples given below.
  2259.  
  2260. *    Matches zero or more characters.  Because the dot  is  treated  as  an
  2261.      ordinary character in a filename, this pattern matches all names.
  2262.  
  2263. *.txt
  2264.      Matches all filenames with the extension "txt".
  2265.  
  2266. *.*  Matches zero or more chars, then a dot, then zero or  more  additional
  2267.      chars.   This  matches  all  filenames that have an extension (with no
  2268.      extension, there is no dot).
  2269.  
  2270. a*   Matches all files that begin with an "a".
  2271.  
  2272. a*b  Matches all files that begin with an "a" and end with a "b",  such  as
  2273.      "ab", "a.b", and "abcde.dcb".
  2274.  
  2275. ???  Each question mark matches exactly  one  character,  so  this  pattern
  2276.      matches all filenames containing exactly three characters.  This would
  2277.      include "abc" and "a.b", but not "a.txt" (remember that the dot counts
  2278.      as a character).
  2279.  
  2280. a?b  Matches all names that begin with an "a", end with  a  "b",  and  have
  2281.      exactly  one  character  between.  This would include "a.b" and "acb",
  2282.      but not "ab", "a.bb", or "a.ba" .
  2283.  
  2284. [abc]
  2285.      Matches only the filenames "a", "b", and "c".
  2286.  
  2287. [abc]*
  2288.      Matches all filenames that begin with "a", "b", or "c".
  2289.  
  2290. [^abc]*
  2291.      Matches all filenames that begin with any character  other  than  "a",
  2292.      "b", or "c".
  2293.  
  2294. *[ab][cd]*
  2295.      Matches all filenames that contain "ac", "ad", "bc", or "bd"  anywhere
  2296.      in their name.
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307. 1.5                               - 32 -                            7/29/94
  2308.  
  2309.  
  2310.  
  2311.